set -x

error() {
	echo $*
	exit 1
}

SWINE=../bin/rel/swine.exe
CHM=../doc/output/swine.chm

if [ -f $SWINE ]
then
	if [ -f $CHM  ]
	then
		name=$(swine input -c "enter name for zip" )
		if [ "$name" != "" ]
		then
			rm -f "$name"
			if zip a "$name" $SWINE $CHM
			then
				$SWINE msg -t "zipped OK" -i info
			fi
		else
			$SWINE msg -t "pack aborted" -i stop
		fi
	else
		 $SWINE msg -t "No compiled help" -i stop
	fi
else
	error "No release executable"
fi
